home *** CD-ROM | disk | FTP | other *** search
- #! /usr/dt/bin/dtksh
- #
- # TransTest1
- #
- # Copyright 2000, Silicon Graphics, Inc.
- # ALL RIGHTS RESERVED
- #
- # UNPUBLISHED -- Rights reserved under the copyright laws of the United
- # States. Use of a copyright notice is precautionary only and does not
- # imply publication or disclosure.
- #
- # U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
- # Use, duplication or disclosure by the Government is subject to restrictions
- # as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
- # in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
- # in similar or successor clauses in the FAR, or the DOD or NASA FAR
- # Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
- # 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
- #
- # THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
- # INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
- # DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
- # PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
- # GRAPHICS, INC.
- #
- ##########################################################################
- # (c) Copyright 1993, 1994 Hewlett-Packard Company
- # (c) Copyright 1993, 1994 International Business Machines Corp.
- # (c) Copyright 1993, 1994 Sun Microsystems, Inc.
- # (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
- # Novell, Inc.
- ##########################################################################
-
-
- #
- # This sample shell script demonstrates the operation of augmented and
- # overridden translations. If the translations are cleared, then both
- # overriding and augmenting the translations will cause all of the new
- # translations to take effect.
- #
-
- Enter()
- {
- echo "EnterNotify ("$1")"
- }
-
- BtnDown()
- {
- echo "ButtonDown ("$1")"
- }
-
- Activate()
- {
- echo "Activate"
- }
-
- Augment()
- {
- XtAugmentTranslations $PB \
- '<EnterNotify>:ksh_eval("Enter augmented")
- <Btn1Down>:ksh_eval("BtnDown 1")
- <Btn3Down>:ksh_eval("BtnDown 3")'
- }
-
- Override()
- {
- XtOverrideTranslations $PB \
- '<EnterNotify>:ksh_eval("Enter overridden")
- <Btn1Down>:ksh_eval("BtnDown 1")'
- }
-
- Uninstall()
- {
- XtUninstallTranslations $PB
- }
-
-
- ######################### Create the Main UI #################################
-
- XtInitialize TOPLEVEL transTest1 TransTest1 "$0" "$@"
- XtSetValues $TOPLEVEL allowShellResize:True
-
- XmCreateForm FORM $TOPLEVEL form
- XtManageChild $FORM
-
- XtCreateManagedWidget PB pb XmPushButton $FORM \
- labelString:"Test Button"
- XtAddCallback $PB activateCallback "Activate"
-
- XtRealizeWidget $TOPLEVEL
-
- XtCreateApplicationShell TOPLEVEL2 listAdd1a TopLevelShell
-
- XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
- orientation:HORIZONTAL \
- numColumns:2 \
- packing:PACK_COLUMN
-
- XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
- labelString:"Augment Translations"
- XtAddCallback $PB1 activateCallback "Augment"
-
- XtCreateManagedWidget PB2 pb2 XmPushButton $RC \
- labelString:"Override Translations"
- XtAddCallback $PB2 activateCallback "Override"
-
- XtCreateManagedWidget PB3 pb3 XmPushButton $RC \
- labelString:"Uninstall Translations"
- XtAddCallback $PB3 activateCallback "Uninstall"
-
- XtRealizeWidget $TOPLEVEL2
-
- XtMainLoop
-